const Router = require('koa-router')
const delectadvice = new Router()
//！拿到前端的数据
//数据库连接池
const pg = require('pg');
let psql = new pg.Pool({
    database: 'running',
    user: 'run',
    port: 5432,
    host: '82.157.94.115',
    password: 'z12345678',
    max: 2
  })
  
delectadvice.post('/delectadvice', async ctx => {
    let {advise_openid} = ctx.request.body
    console.log(advise_openid)
    let deleteContentPostgresql = `delete from advise where advise_openid = '${advise_openid}'`;
    let content = await psql.query(deleteContentPostgresql);

        ctx.body = {
            msg:'删除成功'
        };

})

module.exports = delectadvice;